<template>
  <div>
    <input type="text" v-if="flag" v-aa v-model="ss" @blur="flag = !flag" />
    <button v-else @click="fn">{{ sb }}</button>
  </div>
</template>
<script>
export default {
  name: '',
  model: {
    prop: 'sb'
  },
  props: {
    sb: {
      type: String
    }
  },
  directives: {
    'aa': {
      inserted (ele, h) {
        ele.focus()
      }
    }
  },
  data () {
    return {
      flag: false,
      ss: '我是要要啊'
    }
  },
  created () {
  },
  computed: {
  },
  methods: {
    fn () {
      this.flag = true
    }
  }
}
</script>
<style lang='less'  scoped>
button {
  font-size: 40px;
}
input {
  font-size: 40px;
}
</style>
